package com.wangxin.study8.functions;

import java.util.function.Function;

/**
 * @ClassName FunctionsMain
 * @Description Function 接口接受一个参数并生成结果。默认方法可用于将多个函数链接在一起（compose, andThen)
 * @Author jojo.wang
 * @Date 2019-04-25 15:25
 * @Version 1.0
 **/
public class FunctionsMain {
    public static void main(String[] args) {
        Function<String,Integer> toInt = Integer::valueOf;
        Function<String,String> backToString = toInt.andThen(String::valueOf);
        System.out.println(toInt.apply("111").getClass());
        System.out.println(backToString.apply("111").getClass());
    }
}
